import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-form',
  templateUrl: './form.component.html',
  styleUrls: ['./form.component.css']
})
export class FormComponent implements OnInit {
  public username:string | undefined
  public age:number | undefined
  public userInfor:any
  public sex:number | undefined
  public userCity:string | undefined
  public cityList:string[] = ['北京','上海','天津']
  public hobbyList:any[] = [{
    title:'吃饭🍚',
    checked:true
  },{
    title:'睡觉💤',
    checked:true
  },{
    title:'开冲🐛',
    checked:true
  }]
  constructor() { }

  ngOnInit(): void {
  }
  handleClick():void{
    this.userInfor = {
      name:this.username,
      age:this.age,
      sex:this.sex,
      city:this.userCity,
      loveThing:this.hobbyList
    }
    console.log(this.username,this.age)
  }
}
